home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Orlando_1993 / Devcon93.1 / AREXX / SimpleRexx / SimpleRexx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-11  |  2.9 KB  |  124 lines

  1. /*
  2.  * Simple ARexx interface...
  3.  *
  4.  * This is a very "Simple" interface...
  5. */
  6.  
  7. #ifndef    SIMPLEREXX_TM_H
  8. #define    SIMPLEREXX_TM_H
  9.  
  10. #include    <exec/types.h>
  11. #include    <exec/nodes.h>
  12. #include    <exec/lists.h>
  13. #include    <exec/ports.h>
  14.  
  15. #include    <rexx/storage.h>
  16. #include    <rexx/rxslib.h>
  17.  
  18. /*
  19.  * This is the handle that SimpleRexx will give you
  20.  * when you initialize an ARexx port...
  21.  *
  22.  * The conditional below is used to skip this if we have
  23.  * defined it earlier...
  24. */
  25.  
  26. #ifndef    AREXXCONTEXT
  27.  
  28. typedef void *AREXXCONTEXT;
  29.  
  30. #endif    /* AREXXCONTEXT */
  31.  
  32. /*
  33.  * The value of RexxMsg (from GetARexxMsg) if there was an error returned
  34. */
  35.  
  36. #define    REXX_RETURN_ERROR    ((struct RexxMsg *)-1L)
  37.  
  38. /*
  39.  * This function closes down the ARexx context that was opened
  40.  * with InitARexx...
  41. */
  42.  
  43. void FreeARexx(AREXXCONTEXT);
  44.  
  45. /*
  46.  * This routine initializes an ARexx port for your process
  47.  * This should only be done once per process.  You must call it
  48.  * with a valid application name and you must use the handle it
  49.  * returns in all other calls...
  50.  *
  51.  * NOTE:  The AppName should not have spaces in it...
  52.  *        Example AppNames:  "MyWord" or "FastCalc" etc...
  53.  *        The name *MUST* be less that 16 characters...
  54.  *        If it is not, it will be trimmed...
  55.  *        The name will also be UPPER-CASED...
  56.  *
  57.  * NOTE:  The Default file name extension, if NULL will be
  58.  *        "rexx"  (the "." is automatic)
  59. */
  60.  
  61. AREXXCONTEXT InitARexx(char *,char *);
  62.  
  63. /*
  64.  * This function returns the port name of your ARexx port.
  65.  * It will return NULL if there is no ARexx port...
  66.  *
  67.  * This string is *READ ONLY*  You *MUST NOT* modify it...
  68. */
  69.  
  70. char *ARexxName(AREXXCONTEXT);
  71.  
  72. /*
  73.  * This function returns the signal mask that the Rexx port is
  74.  * using.  It returns NULL if there is no signal...
  75.  *
  76.  * Use this signal bit in your Wait() loop...
  77. */
  78.  
  79. ULONG ARexxSignal(AREXXCONTEXT);
  80.  
  81. /*
  82.  * This function returns a structure that contains the commands sent from
  83.  * ARexx...  You will need to parse it and return the structure back
  84.  * so that the memory can be freed...
  85.  *
  86.  * This returns NULL if there was no message...
  87. */
  88.  
  89. struct RexxMsg *GetARexxMsg(AREXXCONTEXT);
  90.  
  91. /*
  92.  * Use this to return a ARexx message...
  93.  *
  94.  * If you wish to return something, it must be in the RString.
  95.  * If you wish to return an Error, it must be in the Error.
  96. */
  97.  
  98. void ReplyARexxMsg(AREXXCONTEXT,struct RexxMsg *,char *,LONG);
  99.  
  100. /*
  101.  * This function will send a string to ARexx...
  102.  *
  103.  * The default host port will be that of your task...
  104.  *
  105.  * If you set StringFile to TRUE, it will set that bit for the message...
  106.  *
  107.  * Returns TRUE if it send the message, FALSE if it did not...
  108. */
  109.  
  110. short SendARexxMsg(AREXXCONTEXT,char *,short);
  111.  
  112. /*
  113.  * This function will set an error string for the ARexx
  114.  * application in the variable defined as <appname>.LASTERROR
  115.  *
  116.  * Note that this can only happen if there is an ARexx message...
  117.  *
  118.  * This returns TRUE if it worked, FALSE if it did not...
  119. */
  120.  
  121. short SetARexxLastError(AREXXCONTEXT,struct RexxMsg *,char *);
  122.  
  123. #endif    /* SIMPLE_REXX_H */
  124.